Package-level declarations

Types

Link copied to clipboard
interface DracoDecoder

Pluggable codec for Draco mesh compression (KHR_draco_mesh_compression glTF extension).

Link copied to clipboard
class DracoMesh(val positions: FloatArray, val normals: FloatArray? = null, val texCoords: FloatArray? = null, val colors: FloatArray? = null, val batchIds: ShortArray? = null, val indicesShort: ShortArray? = null, val indicesInt: IntArray? = null)

Result of a successful DracoDecoder.decode call. Plain copy-out arrays in the same shape GltfReader would have built from a non-compressed primitive — the rest of the pipeline (interleave + GPU upload + texture binding) treats Draco and non-Draco primitives identically.

Link copied to clipboard
object GlbReader

Reads a glTF 2.0 binary container (GLB) blob into its JSON chunk + BIN chunk. The format:

Link copied to clipboard

Process-level registry of pluggable codecs the glTF parser consults when it encounters compressed payloads. Apps wire concrete implementations once at startup (typically in their entry-point's first lines); GltfReader reads the registry on the streaming hot path without per-call plumbing.

Link copied to clipboard
class GltfImage

Image bytes + MIME type as embedded in (or referenced by) the glTF asset. The reader resolves bufferView-embedded images at parse time so consumers get raw decode-ready bytes either way.

Link copied to clipboard
class GltfLoader(val position: Position)
Link copied to clipboard

glTF material — PBR base color factor + optional base color texture. Phase 2 ignores metallic/roughness/normal/emissive — they're recorded by the reader as defaults for future expansion without consumer churn.

Link copied to clipboard
class GltfMesh

A glTF mesh: a list of primitives that share the mesh's name but may use different materials and topologies. Most photogrammetry b3dms ship one mesh with N primitives — one per material.

Link copied to clipboard
class GltfModel

In-memory model of a parsed glTF 2.0 asset, produced by GltfReader. Carries enough of the spec to drive textured + lit mesh rendering for 3D Tiles content; not a full glTF compliance representation.

Link copied to clipboard

One mesh primitive (one draw call's worth of geometry). Attribute arrays are tightly packed: positions are vec3, normals vec3, texCoords vec2, colors vec3 or vec4. Indices are either uint16 (most cases) or uint32 (large b3dms); exactly one will be non-null.

Link copied to clipboard

One mesh primitive instance — a primitiveIndex under GltfModel.meshes pre-composed with the node's world transform. Consumers iterate this list and don't need to walk the original node tree.

Link copied to clipboard
object GltfReader

Parses a glTF 2.0 JSON document + optional BIN buffer into a GltfModel suitable for driving textured + lit mesh draws. Built for the b3dm / i3dm / cmpt content paths plus the 3D Tiles 1.1 3DTILES_content_gltf extension; reads enough of the spec for photogrammetry-style assets and ignores features the renderer doesn't yet consume (skinning, morph targets, animations, KHR_draco compression, KTX2 textures).

Link copied to clipboard
Link copied to clipboard
interface Ktx2Decoder

Pluggable codec for KTX2 / Basis-Universal texture compression (KHR_texture_basisu glTF extension).

Link copied to clipboard
class Ktx2Image(val rgba: ByteArray, val width: Int, val height: Int)

Result of a successful Ktx2Decoder.decode call. RGBA8888 pixel buffer plus width and height — the rest of the texture pipeline (mipmap generation, GL upload) treats KTX2- sourced and non-KTX2-sourced images identically.

Link copied to clipboard
interface MeshoptDecoder

Pluggable codec for the EXT_meshopt_compression glTF extension.